package com.leyou.trade.repository;

import com.leyou.trade.entity.CartItem;
import org.springframework.data.domain.Sort;
import org.springframework.data.mongodb.repository.MongoRepository;

import java.util.List;

@SuppressWarnings("ALL")
/**
 * @Description :
 * @author     :LD
 */
public interface CartRepository extends MongoRepository<CartItem,String> {
    /**
     * 根据用户id查询
     * @param userId 用户id
     * @return 购物车商品集合
     */
    List<CartItem> findByUserId(Long userId, Sort sort);
}
